package com.imay.live.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.imay.base.activity.BaseActivity;
import com.imay.live.fragment.NoticeChildFragment;
import com.imay.live.fragment.ProfileFragment;
import com.imay.live.R;

import static com.imay.live.fragment.NoticeChildFragment.TYPE_MERGE_MINE;

/**
 * create by nick
 * 合并的消息列表
 */
public class MergeNoticeListActivity extends BaseActivity {


    private static final String MESSAGE_ID_TAG = "message_id_tag";
    private static final String MESSAGE_TYPE_TAG = "message_type_tag";

    public static void start(Context context, int noticeType,long messageId) {
        Intent starter = new Intent(context, MergeNoticeListActivity.class);
        starter.putExtra(MESSAGE_ID_TAG,messageId);
        starter.putExtra(MESSAGE_TYPE_TAG,noticeType);
        context.startActivity(starter);
    }
    @Override
    protected int getLayoutId() {
        return R.layout.activity_meger_notice_list;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        setTitle(getString(R.string.notice_more));
        long messageId = getIntent().getLongExtra(MESSAGE_ID_TAG,0);
        int noticeType = getIntent().getIntExtra(MESSAGE_TYPE_TAG,0);
        NoticeChildFragment fragment = NoticeChildFragment.newInstance(noticeType,messageId);
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.add(R.id.fl_merge_notice_container, fragment);
        fragmentTransaction.commitAllowingStateLoss();
    }
}
